/* GUI CONVERTED from rcrsfc1.p (converter v1.75) Sat Aug 12 23:00:45 2000 */
/* rcrsfc1.p - Release Management Customer Schedules                    */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/*F0PN*/ /*V8:ConvertMode=Maintenance                                   */
/*K1Q4*/ /*V8:WebEnabled=No                                             */
/* REVISION: 7.3    LAST MODIFIED: 12/08/92           BY: WUG *G462*    */
/* REVISION: 7.3    LAST MODIFIED: 08/13/93           BY: WUG *GE19*    */
/* REVISION: 7.3    LAST MODIFIED: 01/11/95           BY: WUG *G0C3*    */
/* REVISION: 8.5    LAST MODIFIED: 10/15/97           BY: *J232* Niranjan R.  */
/* REVISION: 8.6    LAST MODIFIED: 05/20/98           BY: *K1Q4* Alfred Tan   */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00           BY: *N0KP* myb          */


/* UPDATE FORECAST SUBPROGRAM */

{mfdeclre.i}

define input param order_nbr like sod_nbr.
define input param order_line like sod_line.
define input param action as character.
/*J232*/ define input parameter is_req_schd_maint like mfc_logical no-undo.

define variable schtype as integer init 3.

find sod_det where sod_nbr = order_nbr and sod_line = order_line no-lock.

if sod_type = "" then do:
   if action = "remove" then do:
      /* REMOVE FROM FORECAST */
      for each schd_det no-lock
      where schd_type = schtype
      and schd_nbr = sod_nbr
      and schd_line = sod_line
/*J232*/ and schd_rlse_id = sod_curr_rlse_id[schtype]:
/*GUI*/ if global-beam-me-up then undo, leave.

/*J232** and schd_rlse_id = sod_curr_rlse_id[schtype] */
/*J232** and schd_date >= today: */

/*J232*/ if schd_date < today and not is_req_schd_maint then next.
     /*G0C3 MODIFIED FOLLOWING PARAMETER LIST*/
     {gprun.i ""rcrsfca.p""
     "(input order_nbr, input order_line,
     input schd_discr_qty, input 0,
     input schd_date, input schd_time, input schd_reference)"}
/*GUI*/ if global-beam-me-up then undo, leave.

      end.
/*GUI*/ if global-beam-me-up then undo, leave.

   end.
   else do:
      /* ADD TO FORECAST */
      for each schd_det no-lock
      where schd_type = schtype
      and schd_nbr = sod_nbr
      and schd_line = sod_line
/*J232*/ and schd_rlse_id = sod_curr_rlse_id[schtype]:
/*GUI*/ if global-beam-me-up then undo, leave.

/*J232** and schd_rlse_id = sod_curr_rlse_id[schtype] */
/*J232** and schd_date >= today: */

/*J232*/ if schd_date < today and not is_req_schd_maint then next.

     /*G0C3 MODIFIED FOLLOWING PARAMETER LIST*/
     {gprun.i ""rcrsfca.p""
     "(input order_nbr, input order_line,
     input 0, input schd_discr_qty,
     input schd_date, input schd_time, input schd_reference)"}
/*GUI*/ if global-beam-me-up then undo, leave.

      end.
/*GUI*/ if global-beam-me-up then undo, leave.

   end.
end.
